<?php
require("../services/class/listaPlanillasCirugias.php");

$cirugias = new class_listaPlanillasCirugias();
$params = array();
$fecha = $params[0]->fecha_asignada = $_REQUEST['fecha'];
$params[0]->canceladas == '0';
$result = $cirugias->method_getCirOrden($params,$error);
$data = $result->values;
?>
<html>
<head>
	<title>CIRUGIAS POR ORDEN</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="es-es" />
	<link rel="stylesheet" type="text/css" href="style.css" />	
</head>
<body>
	<table width="1000px" align="center" border="0">
	<tr>
		<td valign="top">
			<font class="titulo">SOFAMBAR:<br/>CIRUGIAS DEL DIA <?php echo $result->fecha ?></font>
			<br/><br/>
		</td>
		
	</tr>
	</table>
	<table width="1000px" align="center" border="1" cellpadding="0" cellspacing="0">
		<tr class='subtitulo' align="center">
			<td width="50">Nº</td>
			<td width="200">PACIENTE</td>
			<td width="70">OJO</td>
			<td width="100">DOCTOR</td>
			<td width="180">OBRA SOCIAL</td>
			<td width="250">CIRUGIA</td>
			<td width="250">OBSERVACIONES</td>
		</tr>	
	<?php	
		$i=1;
		foreach($data as $row){
			if($row->obra_social == "")$obra_social = "PARTICULAR"; else $obra_social = $row->obra_social ;
	?>		
		<tr>
			<td class='elemento' align="center"><b><?php echo $i++ ?><br/>(<?php echo $row->hora_citado?>)</b><br/></td>
			<td class='elemento' align="center"><?php echo $row->paciente?></td>
			<td class='elemento' align="center"><?php if($row->ojo=="D") echo "DERECHO";else echo "IZQUIERDO" ?></td>
			<td class='elemento' align="center"><?php echo $row->medico?></td>
			<td class='elemento' align="center"><?php echo $obra_social?></td>
			<td class='elemento' align="center"><?php echo $row->cirugia?></td>
			<td class='elemento' align="left">&nbsp;&nbsp;<?php echo $row->observaciones?></td>
		</tr>
	<?php
		}
	?>
	</table>
</body>
</html>